#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int a = 0;
	int b = 0;
	int count = 0;
	scanf("%d %d",&a,&b);
	for (int i = 1;i <= 32;i++)
	{
		if ((a & 1) == (b & 1))
		{
			count++;
		}
		a >>= 1;
		b >>= 1;
	}
	printf("%d",count);
	return 0;
}